<script setup lang="ts">
const props = defineProps({
  title: {
    type: String,
    default: ""
  },
  isClose: Boolean,
  isIcon: {
    type: Boolean,
    default: true
  },
  style: {
    type: Object,
    default: () => ({})
  },
  size: {
    type: [String, Number],
    default: "14px"
  }
});
const emit = defineEmits(["close"]);
const handelClose = () => {
  emit("close");
};
</script>

<template>
  <div class="title">
    <div class="label">
      <span class="circle" v-if="isIcon"></span>
      <span class="title-label">{{ props.title }}</span>
    </div>
    <icon-close v-if="isClose" @click="handelClose" style="cursor: pointer" :style="style" :size="size" />
  </div>
</template>

<style scoped lang="scss">
.title {
  @include flex-between;

  .label {
    @include flex-align;
  }

  .circle {
    width: 6px;
    height: 6px;
    margin-right: 9px;
    border-radius: 50%;
    background-color: #409eff;
  }

  &-label {
    font-size: 18px;
    color: #131414;
    line-height: 24px;
  }
}
</style>
